<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue基础模板</title>
    <script src="../vue.js"></script>
    <style>
        .box {
            width: 100px;
            height: 100px;
            background-color: skyblue;
            transform: rotateY(0deg);
            transition: all 2s;
        }

        .r {
            transform: translate(1000px) rotateZ(180deg);
        }
    </style>
</head>

<body>
    <div id="app">
        <h1 v-on:click="decrement">{{count}}</h1>
        <h1 @click="changeHot">{{isHot?'热':'冷'}}</h1>
        <div class="box" :class="isMove?'r':''" @mousedown="boxMove"></div>
    </div>

    <script>
        Vue.config.productionTip = false;
        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    count: 0,
                    isHot: false,
                    isMove: false
                }
            },
            methods: {
                decrement() {
                    ++this.count
                },
                changeHot() {
                    this.isHot = !this.isHot
                },
                boxMove() {
                    this.isMove = !this.isMove
                }
            }
        })
    </script>
</body>

</html>